<?php
namespace Home\Controller;
use Think\Controller;
class NotificationController extends Controller {
    public function index(){

    	$article = M('Article');
        $categoryArr = getCategory();   
    	$notifications = $article->where(array('category_id' => $categoryArr['notificationId'] ))->limit(5)->select();
    	$this->assign('notifications',$notifications);

    	$competitions = $article->where(array('category_id'=> $categoryArr['competitionId']))->limit(5)->select();
    	$this->assign('competition1',$competitions[0]);
    	unset($competitions[0]);
    	$this->assign('competitions',$competitions);

 		$this->display('notification');       
    }
    
}